home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / HAM_RAD / 3345.ZIP / SNDCNV.FOR < prev    next >
Text File  |  1988-06-06  |  805b  |  30 lines

  1.     integer*1 sam1,dumy1
  2.     integer*2 sam2
  3.  
  4. c  convert from files of 8-bit straight binary samples (sounds for phil
  5. c  karn's play program) to files of 16-bit 2's-complement binary samples
  6. c  (for franklin antonio's spectrum analyzer program).
  7. c
  8. c  program also drops every other sample.  the files i've seen were sampled
  9. c  at 22ks/s, and don't have any significant energy above 5kHz.  so output
  10. c  file is effectively sampled at 11ks/s
  11.  
  12. c  usage:  sndcnv infile outfile
  13. c
  14.  
  15.     open(unit=2,file=' ',form='binary',blocksize=16384,
  16.      #              status='old')
  17.     open(unit=3,file=' ',form='binary',blocksize=16384,
  18.      #              status='unknown')
  19.  
  20. 10    read(2,end=15) sam1,dumy1
  21.     sam2 = sam1
  22.     sam2 = 32*ieor(sam2,16#ff80)
  23.     write(3) sam2
  24.     go to 10
  25.  
  26. 15    close(2)
  27.     close(3)
  28.  
  29.     end
  30.